OAuth Authentication
Allow CAS to act as an OAuth authentication provider. Please review the specification to learn more.
This page specifically describes how to enable OAuth/OpenID server support for CAS. If you would like to have CAS act as an OAuth/OpenID client communicating with other providers (such as Google, Facebook, etc), see this page.
Actuator Endpoints
The following endpoints are provided by CAS:
The following settings and properties are available from the CAS configuration catalog:
- Required
- Optional
- Signing & Encryption
- Hibernate & JDBC
- Email Servers
- LDAP & Active Directory
- Authentication
- Password Encoding
- Principal Transformation
- Password Policy
cas.monitor.endpoints.jdbc.password-encoder.encoding-algorithm=
The encoding algorithm to use such as |
cas.monitor.endpoints.jdbc.password-encoder.type=NONE
Define the password encoder type to use. Type may be specified as blank or
|
cas.monitor.endpoints.jdbc.driver-class=org.hsqldb.jdbcDriver
The JDBC driver used to connect to the database. |
cas.monitor.endpoints.jdbc.password=
The database connection password. |
cas.monitor.endpoints.jdbc.url=jdbc:hsqldb:mem:cas-hsql-database
The database connection URL. This setting supports the Spring Expression Language. |
cas.monitor.endpoints.jdbc.user=sa
The database user. The database user must have sufficient permissions to be able to handle schema changes and updates, when needed. |
cas.monitor.endpoints.jdbc.password-encoder.character-encoding=UTF-8
The encoding algorithm to use such as 'UTF-8'. Relevant when the type used is |
cas.monitor.endpoints.jdbc.password-encoder.hash-length=16
When used by |
cas.monitor.endpoints.jdbc.password-encoder.secret=
Secret to use with |
cas.monitor.endpoints.jdbc.password-encoder.strength=16
Strength or number of iterations to use for password hashing. Usually relevant when dealing with |
cas.monitor.endpoints.jdbc.autocommit=false
The default auto-commit behavior of connections in the pool. Determined whether queries such as update/insert should be immediately executed without waiting for an underlying transaction. |
cas.monitor.endpoints.jdbc.batch-size=100
A non-zero value enables use of JDBC2 batch updates by Hibernate. e.g. recommended values between 5 and 30. |
cas.monitor.endpoints.jdbc.data-source-name=
Attempts to do a JNDI data source look up for the data source name specified. Will attempt to locate the data source object as is. |
cas.monitor.endpoints.jdbc.ddl-auto=update
Hibernate feature to automatically validate and exports DDL to the schema. By default, creates and drops the schema automatically when a session is starts and ends. Setting the value to
create-drop will result in the loss of all data as soon as CAS is started. For transient data like tickets this is probably not an issue, but in cases like the audit table important data could be lost. Using `update`, while safe for data, is confirmed to result in invalid database state. validate or none settings are likely the only safe options for production use. For more info, see this.
|
cas.monitor.endpoints.jdbc.default-catalog=
Qualifies unqualified table names with the given catalog in generated SQL. |
cas.monitor.endpoints.jdbc.default-schema=
Qualify unqualified table names with the given schema/tablespace in generated SQL. |
cas.monitor.endpoints.jdbc.dialect=org.hibernate.dialect.HSQLDialect
The database dialect is a configuration setting for platform independent software (JPA, Hibernate, etc) which allows such software to translate its generic SQL statements into vendor specific DDL, DML. |
cas.monitor.endpoints.jdbc.fail-fast-timeout=1
Set the pool initialization failure timeout.
connectionTimeout or validationTimeout; they will be honored before this timeout is applied. The default value is one millisecond.
|
cas.monitor.endpoints.jdbc.fetch-size=100
Used to specify number of rows to be fetched in a select query. |
cas.monitor.endpoints.jdbc.generate-statistics=false
Allow hibernate to generate query statistics. |
cas.monitor.endpoints.jdbc.health-query=
The SQL query to be executed to test the validity of connections. This is for "legacy" databases that do not support the JDBC4 |
cas.monitor.endpoints.jdbc.idle-timeout=PT10M
Controls the maximum amount of time that a connection is allowed to sit idle in the pool. This settings supports the
|
cas.monitor.endpoints.jdbc.isolate-internal-queries=false
This property determines whether data source isolates internal pool queries, such as the connection alive test, in their own transaction. Since these are typically read-only queries, it is rarely necessary to encapsulate them in their own transaction. This property only applies if#autocommit is disabled.
|
cas.monitor.endpoints.jdbc.isolation-level-name=ISOLATION_READ_COMMITTED
Defines the isolation level for transactions. @see org.springframework.transaction.TransactionDefinition |
cas.monitor.endpoints.jdbc.leak-threshold=3000
Controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak. |
cas.monitor.endpoints.jdbc.physical-naming-strategy-class-name=org.apereo.cas.hibernate.CasHibernatePhysicalNamingStrategy
Fully-qualified name of the class that can control the physical naming strategy of hibernate. |
cas.monitor.endpoints.jdbc.propagation-behavior-name=PROPAGATION_REQUIRED
Defines the propagation behavior for transactions. @see org.springframework.transaction.TransactionDefinition |
cas.monitor.endpoints.jdbc.properties=
Additional settings provided by Hibernate (or the connection provider) in form of key-value pairs. |
cas.monitor.endpoints.jdbc.query=
Query to execute in order to authenticate users via JDBC. Example: |
cas.monitor.endpoints.jdbc.read-only=false
Configures the Connections to be added to the pool as read-only Connections. |
cas.monitor.endpoints.jdbc.role-prefix=
Prefix to add to the role. |
cas.monitor.endpoints.jdbc.pool.keep-alive-time=0
This property controls the keepalive interval for a connection in the pool. An in-use connection will never be tested by the keepalive thread, only when it is idle will it be tested. Default is zero, which disables this feature. This settings supports the
|
cas.monitor.endpoints.jdbc.pool.max-size=18
Controls the maximum number of connections to keep in the pool, including both idle and in-use connections. |
cas.monitor.endpoints.jdbc.pool.max-wait=PT2S
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout. This settings supports the
|
cas.monitor.endpoints.jdbc.pool.maximum-lifetime=PT10M
This property controls the maximum lifetime of a connection in the pool. When a connection reaches this timeout, even if recently used, it will be retired from the pool. An in-use connection will never be retired, only when it is idle will it be removed. This settings supports the
|
cas.monitor.endpoints.jdbc.pool.min-size=6
Controls the minimum size that the pool is allowed to reach, including both idle and in-use connections. |
cas.monitor.endpoints.jdbc.pool.name=
Set the name of the connection pool. This is primarily used for the MBean to uniquely identify the pool configuration. |
cas.monitor.endpoints.jdbc.pool.suspension=false
Whether or not pool suspension is allowed. There is a performance impact when pool suspension is enabled. Unless you need it (for a redundancy system for example) do not enable it. |
cas.monitor.endpoints.jdbc.pool.timeout-millis=1000
The maximum number of milliseconds that the pool will wait for a connection to be validated as alive. |
Control global properties that are relevant to Hibernate, when CAS attempts to employ and utilize database resources, connections and queries.
cas.jdbc.case-insensitive=false
When choosing physical table names, determine whether names should be considered case-insensitive. |
cas.jdbc.gen-ddl=true
Whether to generate DDL after the EntityManagerFactory has been initialized creating/updating all relevant tables. |
cas.jdbc.physical-table-names=
Indicate a physical table name to be used by the hibernate naming strategy in case table names need to be customized for the specific type of database. The key here indicates the CAS-provided table name and the value is the translate physical name for the database. If a match is not found for the CAS-provided table name, then that name will be used by default. |
cas.jdbc.show-sql=false
Whether SQL queries should be displayed in the console/logs. |
If you need to design your own password encoding scheme where the type is specified as a fully qualified Java class name, the structure of the class would be similar to the following:
1
2
3
4
5
6
7
8
9
10
11
package org.example.cas;
import org.springframework.security.crypto.codec.*;
import org.springframework.security.crypto.password.*;
public class MyEncoder extends AbstractPasswordEncoder {
@Override
protected byte[] encode(CharSequence rawPassword, byte[] salt) {
return ...
}
}
If you need to design your own password encoding scheme where the type is specified as a path to a Groovy script, the structure of the script would be similar to the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.util.*
byte[] run(final Object... args) {
def rawPassword = args[0]
def generatedSalt = args[1]
def logger = args[2]
def casApplicationContext = args[3]
logger.debug("Encoding password...")
return ...
}
Boolean matches(final Object... args) {
def rawPassword = args[0]
def encodedPassword = args[1]
def logger = args[2]
def casApplicationContext = args[3]
logger.debug("Does match or not ?");
return ...
The following settings and properties are available from the CAS configuration catalog:
- Required
- Optional
- Signing & Encryption
- Hibernate & JDBC
- Email Servers
- LDAP & Active Directory
- Authentication
- Password Encoding
- Principal Transformation
- Password Policy
cas.monitor.endpoints.ldap.base-dn=
Base DN to use. There may be scenarios where different parts of a single LDAP tree could be considered as base-dns. Rather than duplicating the LDAP configuration block for each individual base-dn, each entry can be specified and joined together using a special delimiter character. The user DN is retrieved using the combination of all base-dn and DN resolvers in the order defined. DN resolution should fail if multiple DNs are found. Otherwise the first DN found is returned. Usual syntax is: |
cas.monitor.endpoints.ldap.bind-credential=
The bind credential to use when connecting to LDAP. |
cas.monitor.endpoints.ldap.bind-dn=
The bind DN to use when connecting to LDAP. LDAP connection configuration injected into the LDAP connection pool can be initialized with the following parameters:
|
cas.monitor.endpoints.ldap.ldap-url=
The LDAP url to the server. More than one may be specified, separated by space and/or comma. |
cas.monitor.endpoints.ldap.search-filter=
User filter to use for searching. Syntax is file:/path/to/GroovyScript.groovy to fully build the final filter template dynamically.
|
cas.monitor.endpoints.ldap.type=AUTHENTICATED
The authentication type.
|
cas.monitor.endpoints.ldap.allow-multiple-dns=false
Whether search/query results are allowed to match on multiple DNs, or whether a single unique DN is expected for the result. |
cas.monitor.endpoints.ldap.allow-multiple-entries=false
Set if multiple Entries are allowed. |
cas.monitor.endpoints.ldap.binary-attributes=
Indicate the collection of attributes that are to be tagged and processed as binary attributes by the underlying search resolver. |
cas.monitor.endpoints.ldap.block-wait-time=PT3S
The length of time the pool will block. By default the pool will block indefinitely and there is no guarantee that waiting threads will be serviced in the order in which they made their request. This option should be used with a blocking connection pool when you need to control the exact number of connections that can be created This settings supports the
|
cas.monitor.endpoints.ldap.connect-timeout=PT5S
Sets the maximum amount of time that connects will block. This settings supports the
|
cas.monitor.endpoints.ldap.connection-strategy=
If multiple URLs are provided as the ldapURL this describes how each URL will be processed.
|
cas.monitor.endpoints.ldap.deref-aliases=
Define how aliases are de-referenced. Accepted values are:
|
cas.monitor.endpoints.ldap.disable-pooling=false
Whether to use a pooled connection factory in components. |
cas.monitor.endpoints.ldap.dn-format=
Specify the dn format accepted by the AD authenticator, etc. Example format might be |
cas.monitor.endpoints.ldap.enhance-with-entry-resolver=true
Whether specific search entry resolvers need to be set on the authenticator, or the default should be used. |
cas.monitor.endpoints.ldap.fail-fast=true
Attempt to populate the connection pool early on startup and fail quickly if something goes wrong. |
cas.monitor.endpoints.ldap.follow-referrals=true
Set if search referrals should be followed. |
cas.monitor.endpoints.ldap.hostname-verifier=DEFAULT
Hostname verification options. Available values are as follows:
|
cas.monitor.endpoints.ldap.idle-time=PT10M
Removes connections from the pool based on how long they have been idle in the available queue. Prunes connections that have been idle for more than the indicated amount. This settings supports the
|
cas.monitor.endpoints.ldap.keystore=
Path to the keystore used for SSL connections. Typically contains SSL certificates for the LDAP server. This setting supports the Spring Expression Language. |
cas.monitor.endpoints.ldap.keystore-password=
Keystore password. This setting supports the Spring Expression Language. |
cas.monitor.endpoints.ldap.keystore-type=
The type of keystore. |
cas.monitor.endpoints.ldap.max-pool-size=10
Maximum LDAP connection pool size which the pool can use to grow. |
cas.monitor.endpoints.ldap.min-pool-size=3
Minimum LDAP connection pool size. Size the pool should be initialized to and pruned to |
cas.monitor.endpoints.ldap.name=
Name of the LDAP handler. |
cas.monitor.endpoints.ldap.page-size=0
Request that the server return results in batches of a specific size. See RFC 2696. This control is often used to work around server result size limits. A negative/zero value disables paged requests. |
cas.monitor.endpoints.ldap.pool-passivator=BIND
You may receive unexpected LDAP failures, when CAS is configured to authenticate using
|
cas.monitor.endpoints.ldap.principal-attribute-password=
If principalAttributePassword is empty then a user simple bind is done to validate credentials otherwise the given attribute is compared with the given principalAttributePassword using the SHA encrypted value of it. For the anonymous authentication type, if principalAttributePassword is empty then a user simple bind is done to validate credentials otherwise the given attribute is compared with the given principalAttributePassword using the SHA encrypted value of it. |
cas.monitor.endpoints.ldap.prune-period=PT2H
Removes connections from the pool based on how long they have been idle in the available queue. Run the pruning process at the indicated interval. This settings supports the
|
cas.monitor.endpoints.ldap.resolve-from-attribute=
If this attribute is set, the value found in the first attribute value will be used in place of the DN. |
cas.monitor.endpoints.ldap.response-timeout=PT5S
Duration of time to wait for responses. This settings supports the
|
cas.monitor.endpoints.ldap.sasl-authorization-id=
SASL authorization id. |
cas.monitor.endpoints.ldap.sasl-mechanism=
The SASL mechanism. |
cas.monitor.endpoints.ldap.sasl-mutual-auth=
SASL mutual auth is enabled? |
cas.monitor.endpoints.ldap.sasl-quality-of-protection=
SASL quality of protected. |
cas.monitor.endpoints.ldap.sasl-realm=
The SASL realm. |
cas.monitor.endpoints.ldap.sasl-security-strength=
SASL security strength. |
cas.monitor.endpoints.ldap.search-entry-handlers=
Search handlers. |
cas.monitor.endpoints.ldap.subtree-search=true
Whether subtree searching is allowed. |
cas.monitor.endpoints.ldap.trust-certificates=
Path of the trust certificates to use for the SSL connection. Ignores keystore-related settings when activated and used. |
cas.monitor.endpoints.ldap.trust-manager=
Trust Manager options. Trust managers are responsible for managing the trust material that is used when making LDAP trust decisions, and for deciding whether credentials presented by a peer should be accepted. Accepted values are: *
|
cas.monitor.endpoints.ldap.trust-store=
Path to the keystore used to determine which certificates or certificate authorities should be trusted. Used when connecting to an LDAP server via LDAPS or startTLS connection. If left blank, the default truststore for the Java runtime is used. This setting supports the Spring Expression Language. |
cas.monitor.endpoints.ldap.trust-store-password=
Password needed to open the truststore. This setting supports the Spring Expression Language. |
cas.monitor.endpoints.ldap.trust-store-type=
The type of trust keystore that determines which certificates or certificate authorities are trusted. Types depend on underlying java platform, typically |
cas.monitor.endpoints.ldap.use-start-tls=false
Whether TLS should be used and enabled when establishing the connection. |
cas.monitor.endpoints.ldap.validate-on-checkout=true
Whether connections should be validated when loaned out from the pool. |
cas.monitor.endpoints.ldap.validate-period=PT5M
Period at which pool should be validated. This settings supports the
|
cas.monitor.endpoints.ldap.validate-periodically=true
Whether connections should be validated periodically when the pool is idle. |
cas.monitor.endpoints.ldap.validate-timeout=PT5S
Period at which validation operations may time out. This settings supports the
|
cas.monitor.endpoints.ldap.ldap-authz.allow-multiple-results=false
Indicate whether the LDAP search query is allowed to return multiple entries. |
cas.monitor.endpoints.ldap.ldap-authz.base-dn=
Base DN to start the search. |
cas.monitor.endpoints.ldap.ldap-authz.group-attribute=
Attribute expected to be found on the entry resulting from the group search whose value is going to be used to construct roles. The final value is always prefixed with |
cas.monitor.endpoints.ldap.ldap-authz.group-base-dn=
Base DN to start the search looking for groups. |
cas.monitor.endpoints.ldap.ldap-authz.group-filter=
Search filter to begin looking for groups. |
cas.monitor.endpoints.ldap.ldap-authz.group-prefix=
A prefix that is prepended to the group attribute value to construct an authorized role. |
cas.monitor.endpoints.ldap.ldap-authz.role-attribute=uugid
Attribute expected to be found on the entry whose value is going to be used to construct roles. The final value is always prefixed with |
cas.monitor.endpoints.ldap.ldap-authz.role-prefix=ROLE_
Prefix for the role. |
cas.monitor.endpoints.ldap.ldap-authz.search-filter=
LDAP search filter to locate accounts. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].case-change.attribute-name-case-change=
The Attribute name case change. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].case-change.attribute-names=
The Attribute names. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].case-change.attribute-value-case-change=
The Attribute value case change. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].case-change.dn-case-change=
The Dn case change. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].dn-attribute.add-if-exists=
The Add if exists. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].dn-attribute.dn-attribute-name=entryDN
The Dn attribute name. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].merge-attribute.attribute-names=
The Attribute names. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].merge-attribute.merge-attribute-name=
The Merge attribute name. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].primary-group-id.base-dn=
The Base dn. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].primary-group-id.group-filter=(&(objectClass=group)(objectSid={0}))
The Group filter. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].recursive.merge-attributes=
The Merge attributes. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].recursive.search-attribute=
The Search attribute. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].search-referral.limit=10
The default referral limit. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].search-result.limit=10
The default referral limit. |
cas.monitor.endpoints.ldap.search-entry-handlers[0].type=
The type of search entry handler to choose. Available values are as follows:
|
cas.monitor.endpoints.ldap.validator.attribute-name=objectClass
Attribute name to use for the compare validator. |
cas.monitor.endpoints.ldap.validator.attribute-value=top
Attribute values to use for the compare validator. |
cas.monitor.endpoints.ldap.validator.base-dn=
Base DN to use for the search request of the search validator. |
cas.monitor.endpoints.ldap.validator.dn=
DN to compare to use for the compare validator. |
cas.monitor.endpoints.ldap.validator.scope=OBJECT
Search scope to use for the search request of the search validator. |
cas.monitor.endpoints.ldap.validator.search-filter=(objectClass=*)
Search filter to use for the search request of the search validator. |
cas.monitor.endpoints.ldap.validator.type=search
Determine the LDAP validator type. The following LDAP validators can be used to test connection health status:
|
LDAP Scriptable Search Filter
LDAP search filters can point to an external Groovy script to dynamically construct the final filter template.
The script itself may be designed as:
1
2
3
4
5
6
7
8
9
10
11
12
import org.ldaptive.*
import org.springframework.context.*
def run(Object[] args) {
def filter = (FilterTemplate) args[0]
def parameters = (Map) args[1]
def applicationContext = (ApplicationContext) args[2]
def logger = args[3]
logger.info("Configuring LDAP filter")
filter.setFilter("uid=something")
}
The following parameters are passed to the script:
| Parameter | Description |
|---|---|
filter |
FilterTemplate to be updated by the script and used for the LDAP query. |
parameters |
Map of query parameters which may be used to construct the final filter. |
applicationContext |
Reference to the Spring ApplicationContext reference. |
logger |
The object responsible for issuing log messages such as logger.info(...). |
The following settings and properties are available from the CAS configuration catalog:
- Required
- Optional
- Signing & Encryption
- Hibernate & JDBC
- Email Servers
- LDAP & Active Directory
- Authentication
- Password Encoding
- Principal Transformation
- Password Policy
cas.monitor.endpoints.jaas.login-config=
JAAS login resource file. |
cas.monitor.endpoints.jaas.login-context-name=
The login context name should coincide with a given index in the login config specified. This name is used as the index to the configuration specified in the login config property. JAASTest { org.springframework.security.authentication.jaas.TestLoginModule required; </code>; In the above example, JAASTest should be set as the context name.
|
cas.monitor.endpoints.jaas.refresh-configuration-on-startup=true
If set, a call to |
Delete token by id.
|
org.apereo.cas.support.oauth.web.mgmt.OAuth20TokenManagementEndpoint |
Endpoint Details: oauthTokens/{ticketId}
Endpoint Parameters:
-
ticketId
CAS, being a Spring-Boot application at heart, includes a number of endpoints to help you monitor and manage the server when it’s pushed to production. You can choose to manage and monitor the deployment using HTTP endpoints, referred to as actuators.
In essence, actuator endpoints bring production-ready features to CAS. Monitoring a running CAS instance, gathering metrics, understanding traffic or the state of our database becomes trivial with such endpoints. The main benefit of these endpoints is that we can get production grade tools without having to actually implement these features ourselves. Actuators are mainly used to expose operational information about the running application – health, metrics, etc. These are HTTP endpoints or JMX beans to enable us to interact with it.
Actuator endpoints are presented by CAS in two categories:
- Those that are owned and defined by the CAS project.
- Those that are owned and defined by third-party projects, frameworks and libraries such as Spring Boot.
Note that by default the only endpoints exposed over the web
are info, status, health and configurationMetadata.
Other endpoints need to be explicitly enabled and then
exposed over the web in CAS settings in order to allow access.
To enable and expose an actuator endpoint:
1
2
3
4
5
management.endpoint.oauthTokens.enabled=true
management.endpoints.web.exposure.include=oauthTokens
# Choose the proper security access level...
# cas.monitor.endpoints.endpoint.oauthTokens.access=PERMIT
The following settings and properties are available from the CAS configuration catalog:
- Required
- Optional
- Signing & Encryption
- Hibernate & JDBC
- Email Servers
- LDAP & Active Directory
- Authentication
- Password Encoding
- Principal Transformation
- Password Policy
cas.monitor.endpoints.form-login-enabled=false
Control whether access to endpoints can be controlled via form-based login over the web via a special admin login endpoint. |
cas.monitor.endpoints.endpoint.[key].access=
Define the security access level of the endpoint. Available values are as follows:
|
cas.monitor.endpoints.endpoint.[key].required-authorities=
Required user authorities. |
cas.monitor.endpoints.endpoint.[key].required-ip-addresses=
Required ip addresses. |
cas.monitor.endpoints.endpoint.[key].required-roles=
Required user roles. |
Endpoints may be mapped to custom arbitrary endpoints. For example,
to remap the health endpoint to healthcheck,
specify the following settings:
1
# management.endpoints.web.path-mapping.health=healthcheck
management.endpoint.health.cache.time-to-live=0ms
Maximum time that a response can be cached. |
management.endpoint.health.enabled=true
Whether to enable the health endpoint. |
management.endpoint.health.group=
Health endpoint groups. |
management.endpoint.health.logging.slow-indicator-threshold=10s
Threshold after which a warning will be logged for slow health indicators. |
management.endpoint.health.probes.add-additional-paths=false
Whether to make the liveness and readiness health groups available on the main server port. |
management.endpoint.health.probes.enabled=false
Whether to enable liveness and readiness probes. |
management.endpoint.health.roles=
Roles used to determine whether a user is authorized to be shown details. When empty, all authenticated users are authorized. |
management.endpoint.health.show-components=
When to show components. If not specified the 'show-details' setting will be used. |
management.endpoint.health.show-details=never
When to show full health details. |
management.endpoint.health.status.http-mapping=
Mapping of health statuses to HTTP status codes. By default, registered health statuses map to sensible defaults (for example, UP maps to 200). |
management.endpoint.health.status.order=DOWNOUT_OF_SERVICEUPUNKNOWN
Comma-separated list of health statuses in order of severity. |
management.endpoints.enabled-by-default=
Whether to enable or disable all endpoints by default. |
management.endpoints.jmx.domain=org.springframework.boot
Endpoints JMX domain name. Fallback to 'spring.jmx.default-domain' if set. |
management.endpoints.jmx.exposure.exclude=
Endpoint IDs that should be excluded or '*' for all. |
management.endpoints.jmx.exposure.include=*
Endpoint IDs that should be included or '*' for all. |
management.endpoints.jmx.static-names=
Additional static properties to append to all ObjectNames of MBeans representing Endpoints. |
management.endpoints.jmx.unique-names=
Whether unique runtime object names should be ensured. Deprecation status is |
management.endpoints.migrate-legacy-ids=false
Whether to transparently migrate legacy endpoint IDs. |
management.endpoints.web.base-path=/actuator
Base path for Web endpoints. Relative to the servlet context path (server.servlet.context-path) or WebFlux base path (spring.webflux.base-path) when the management server is sharing the main server port. Relative to the management server base path (management.server.base-path) when a separate management server port (management.server.port) is configured. |
management.endpoints.web.cors.allow-credentials=
Whether credentials are supported. When not set, credentials are not supported. |
management.endpoints.web.cors.allowed-headers=
Comma-separated list of headers to allow in a request. '*' allows all headers. |
management.endpoints.web.cors.allowed-methods=
Comma-separated list of methods to allow. '*' allows all methods. When not set, defaults to GET. |
management.endpoints.web.cors.allowed-origin-patterns=
Comma-separated list of origin patterns to allow. Unlike allowed origins which only supports '*', origin patterns are more flexible (for example 'https://*.example.com') and can be used when credentials are allowed. When no allowed origin patterns or allowed origins are set, CORS support is disabled. |
management.endpoints.web.cors.allowed-origins=
Comma-separated list of origins to allow. '*' allows all origins. When credentials are allowed, '*' cannot be used and origin patterns should be configured instead. When no allowed origins or allowed origin patterns are set, CORS support is disabled. |
management.endpoints.web.cors.exposed-headers=
Comma-separated list of headers to include in a response. |
management.endpoints.web.cors.max-age=1800s
How long the response from a pre-flight request can be cached by clients. If a duration suffix is not specified, seconds will be used. |
management.endpoints.web.discovery.enabled=true
Whether the discovery page is enabled. |
management.endpoints.web.exposure.exclude=
Endpoint IDs that should be excluded or '*' for all. |
management.endpoints.web.exposure.include=health
Endpoint IDs that should be included or '*' for all. |
management.endpoints.web.path-mapping=
Mapping between endpoint IDs and the path that should expose them. |
management.health.binders.enabled=true
Allows to enable/disable binder's' health indicators. If you want to disable health indicator completely, then set it to `false`. |
management.health.cassandra.enabled=true
Whether to enable Cassandra health check. |
management.health.couchbase.enabled=true
Whether to enable Couchbase health check. |
management.health.couchbase.timeout=1000ms
Timeout for getting the Bucket information from the server. Deprecation status is |
management.health.db.enabled=true
Whether to enable database health check. |
management.health.db.ignore-routing-data-sources=false
Whether to ignore AbstractRoutingDataSources when creating database health indicators. |
management.health.defaults.enabled=true
Whether to enable default health indicators. |
management.health.diskspace.enabled=true
Whether to enable disk space health check. |
management.health.diskspace.path=
Path used to compute the available disk space. |
management.health.diskspace.threshold=10MB
Minimum disk space that should be available. |
management.health.elasticsearch.enabled=true
Whether to enable Elasticsearch health check. |
management.health.elasticsearch.indices=
Comma-separated index names. Deprecation status is |
management.health.elasticsearch.response-timeout=
Time to wait for a response from the cluster. Deprecation status is |
management.health.influxdb.enabled=true
Whether to enable InfluxDB health check. |
management.health.jms.enabled=true
Whether to enable JMS health check. |
management.health.ldap.enabled=true
Whether to enable LDAP health check. |
management.health.livenessstate.enabled=false
Whether to enable liveness state health check. |
management.health.mail.enabled=true
Whether to enable Mail health check. |
management.health.mongo.enabled=true
Whether to enable MongoDB health check. |
management.health.neo4j.enabled=true
Whether to enable Neo4j health check. |
management.health.ping.enabled=true
Whether to enable ping health check. |
management.health.probes.enabled=false
Whether to enable liveness and readiness probes. Deprecation status is |
management.health.rabbit.enabled=true
Whether to enable RabbitMQ health check. |
management.health.readinessstate.enabled=false
Whether to enable readiness state health check. |
management.health.redis.enabled=true
Whether to enable Redis health check. |
management.health.refresh.enabled=true
Enable the health endpoint for the refresh scope. |
management.health.solr.enabled=true
Whether to enable Solr health check. |
management.health.zookeeper.enabled=true
Enable the health endpoint for zookeeper. |
spring.security.user.name=user
Default user name. |
spring.security.user.password=
Password for the default user name. |
spring.security.user.roles=
Granted roles for the default user name. |
For basic authentication, the default username is casuser. The password may be automatically generated at startup and displayed in CAS logs if it is left undefined in CAS settings. Additional sources may also be defined that would authenticate the request via JAAS, LDAP, JDBC, etc.
Once endpoints are enabled and exposed, the security of all provided endpoints is handled by the Spring Security project. Protection and access to each endpoint is controlled via CAS settings individually such that you may decide a specific security level and method of authentication for each endpoint independently.
- If CAS is configured to NOT enforce endpoint security rules, then all endpoints are considered sensitive and require authentication, typically handled via basic authentication with master credentials defined in CAS settings.
- If CAS is configured to enforce endpoint security rules, then each endpoint may be tagged with a specific security rule allowing access via authorized IP addresses, basic credentials, roles and attributes, etc.
There is a special endpoint named defaults which serves as a shortcut that
controls the security of all endpoints, if left undefined in CAS settings.
To enable additional logging, configure the log4j configuration file to add the following levels:
1
2
3
4
5
6
7
8
<Logger name="org.pac4j" level="debug" additivity="false">
<AppenderRef ref="console" />
<AppenderRef ref="file" />
</Logger>
<Logger name="org.springframework.security" level="debug" additivity="false">
<AppenderRef ref="console" />
<AppenderRef ref="file" />
</Logger>
Get access and/or refresh tokens.
Collection |
|
org.apereo.cas.support.oauth.web.mgmt.OAuth20TokenManagementEndpoint |
Endpoint Details: oauthTokens
CAS, being a Spring-Boot application at heart, includes a number of endpoints to help you monitor and manage the server when it’s pushed to production. You can choose to manage and monitor the deployment using HTTP endpoints, referred to as actuators.
In essence, actuator endpoints bring production-ready features to CAS. Monitoring a running CAS instance, gathering metrics, understanding traffic or the state of our database becomes trivial with such endpoints. The main benefit of these endpoints is that we can get production grade tools without having to actually implement these features ourselves. Actuators are mainly used to expose operational information about the running application – health, metrics, etc. These are HTTP endpoints or JMX beans to enable us to interact with it.
Actuator endpoints are presented by CAS in two categories:
- Those that are owned and defined by the CAS project.
- Those that are owned and defined by third-party projects, frameworks and libraries such as Spring Boot.
Note that by default the only endpoints exposed over the web
are info, status, health and configurationMetadata.
Other endpoints need to be explicitly enabled and then
exposed over the web in CAS settings in order to allow access.
To enable and expose an actuator endpoint:
1
2
3
4
5
management.endpoint.oauthTokens.enabled=true
management.endpoints.web.exposure.include=oauthTokens
# Choose the proper security access level...
# cas.monitor.endpoints.endpoint.oauthTokens.access=PERMIT
The following settings and properties are available from the CAS configuration catalog:
- Required
- Optional
- Signing & Encryption
- Hibernate & JDBC
- Email Servers
- LDAP & Active Directory
- Authentication
- Password Encoding
- Principal Transformation
- Password Policy
cas.monitor.endpoints.form-login-enabled=false
Control whether access to endpoints can be controlled via form-based login over the web via a special admin login endpoint. |
cas.monitor.endpoints.endpoint.[key].access=
Define the security access level of the endpoint. Available values are as follows:
|
cas.monitor.endpoints.endpoint.[key].required-authorities=
Required user authorities. |
cas.monitor.endpoints.endpoint.[key].required-ip-addresses=
Required ip addresses. |
cas.monitor.endpoints.endpoint.[key].required-roles=
Required user roles. |
Endpoints may be mapped to custom arbitrary endpoints. For example,
to remap the health endpoint to healthcheck,
specify the following settings:
1
# management.endpoints.web.path-mapping.health=healthcheck
management.endpoint.health.cache.time-to-live=0ms
Maximum time that a response can be cached. |
management.endpoint.health.enabled=true
Whether to enable the health endpoint. |
management.endpoint.health.group=
Health endpoint groups. |
management.endpoint.health.logging.slow-indicator-threshold=10s
Threshold after which a warning will be logged for slow health indicators. |
management.endpoint.health.probes.add-additional-paths=false
Whether to make the liveness and readiness health groups available on the main server port. |
management.endpoint.health.probes.enabled=false
Whether to enable liveness and readiness probes. |
management.endpoint.health.roles=
Roles used to determine whether a user is authorized to be shown details. When empty, all authenticated users are authorized. |
management.endpoint.health.show-components=
When to show components. If not specified the 'show-details' setting will be used. |
management.endpoint.health.show-details=never
When to show full health details. |
management.endpoint.health.status.http-mapping=
Mapping of health statuses to HTTP status codes. By default, registered health statuses map to sensible defaults (for example, UP maps to 200). |
management.endpoint.health.status.order=DOWNOUT_OF_SERVICEUPUNKNOWN
Comma-separated list of health statuses in order of severity. |
management.endpoints.enabled-by-default=
Whether to enable or disable all endpoints by default. |
management.endpoints.jmx.domain=org.springframework.boot
Endpoints JMX domain name. Fallback to 'spring.jmx.default-domain' if set. |
management.endpoints.jmx.exposure.exclude=
Endpoint IDs that should be excluded or '*' for all. |
management.endpoints.jmx.exposure.include=*
Endpoint IDs that should be included or '*' for all. |
management.endpoints.jmx.static-names=
Additional static properties to append to all ObjectNames of MBeans representing Endpoints. |
management.endpoints.jmx.unique-names=
Whether unique runtime object names should be ensured. Deprecation status is |
management.endpoints.migrate-legacy-ids=false
Whether to transparently migrate legacy endpoint IDs. |
management.endpoints.web.base-path=/actuator
Base path for Web endpoints. Relative to the servlet context path (server.servlet.context-path) or WebFlux base path (spring.webflux.base-path) when the management server is sharing the main server port. Relative to the management server base path (management.server.base-path) when a separate management server port (management.server.port) is configured. |
management.endpoints.web.cors.allow-credentials=
Whether credentials are supported. When not set, credentials are not supported. |
management.endpoints.web.cors.allowed-headers=
Comma-separated list of headers to allow in a request. '*' allows all headers. |
management.endpoints.web.cors.allowed-methods=
Comma-separated list of methods to allow. '*' allows all methods. When not set, defaults to GET. |
management.endpoints.web.cors.allowed-origin-patterns=
Comma-separated list of origin patterns to allow. Unlike allowed origins which only supports '*', origin patterns are more flexible (for example 'https://*.example.com') and can be used when credentials are allowed. When no allowed origin patterns or allowed origins are set, CORS support is disabled. |
management.endpoints.web.cors.allowed-origins=
Comma-separated list of origins to allow. '*' allows all origins. When credentials are allowed, '*' cannot be used and origin patterns should be configured instead. When no allowed origins or allowed origin patterns are set, CORS support is disabled. |
management.endpoints.web.cors.exposed-headers=
Comma-separated list of headers to include in a response. |
management.endpoints.web.cors.max-age=1800s
How long the response from a pre-flight request can be cached by clients. If a duration suffix is not specified, seconds will be used. |
management.endpoints.web.discovery.enabled=true
Whether the discovery page is enabled. |
management.endpoints.web.exposure.exclude=
Endpoint IDs that should be excluded or '*' for all. |
management.endpoints.web.exposure.include=health
Endpoint IDs that should be included or '*' for all. |
management.endpoints.web.path-mapping=
Mapping between endpoint IDs and the path that should expose them. |
management.health.binders.enabled=true
Allows to enable/disable binder's' health indicators. If you want to disable health indicator completely, then set it to `false`. |
management.health.cassandra.enabled=true
Whether to enable Cassandra health check. |
management.health.couchbase.enabled=true
Whether to enable Couchbase health check. |
management.health.couchbase.timeout=1000ms
Timeout for getting the Bucket information from the server. Deprecation status is |
management.health.db.enabled=true
Whether to enable database health check. |
management.health.db.ignore-routing-data-sources=false
Whether to ignore AbstractRoutingDataSources when creating database health indicators. |
management.health.defaults.enabled=true
Whether to enable default health indicators. |
management.health.diskspace.enabled=true
Whether to enable disk space health check. |
management.health.diskspace.path=
Path used to compute the available disk space. |
management.health.diskspace.threshold=10MB
Minimum disk space that should be available. |
management.health.elasticsearch.enabled=true
Whether to enable Elasticsearch health check. |
management.health.elasticsearch.indices=
Comma-separated index names. Deprecation status is |
management.health.elasticsearch.response-timeout=
Time to wait for a response from the cluster. Deprecation status is |
management.health.influxdb.enabled=true
Whether to enable InfluxDB health check. |
management.health.jms.enabled=true
Whether to enable JMS health check. |
management.health.ldap.enabled=true
Whether to enable LDAP health check. |
management.health.livenessstate.enabled=false
Whether to enable liveness state health check. |
management.health.mail.enabled=true
Whether to enable Mail health check. |
management.health.mongo.enabled=true
Whether to enable MongoDB health check. |
management.health.neo4j.enabled=true
Whether to enable Neo4j health check. |
management.health.ping.enabled=true
Whether to enable ping health check. |
management.health.probes.enabled=false
Whether to enable liveness and readiness probes. Deprecation status is |
management.health.rabbit.enabled=true
Whether to enable RabbitMQ health check. |
management.health.readinessstate.enabled=false
Whether to enable readiness state health check. |
management.health.redis.enabled=true
Whether to enable Redis health check. |
management.health.refresh.enabled=true
Enable the health endpoint for the refresh scope. |
management.health.solr.enabled=true
Whether to enable Solr health check. |
management.health.zookeeper.enabled=true
Enable the health endpoint for zookeeper. |
spring.security.user.name=user
Default user name. |
spring.security.user.password=
Password for the default user name. |
spring.security.user.roles=
Granted roles for the default user name. |
For basic authentication, the default username is casuser. The password may be automatically generated at startup and displayed in CAS logs if it is left undefined in CAS settings. Additional sources may also be defined that would authenticate the request via JAAS, LDAP, JDBC, etc.
Once endpoints are enabled and exposed, the security of all provided endpoints is handled by the Spring Security project. Protection and access to each endpoint is controlled via CAS settings individually such that you may decide a specific security level and method of authentication for each endpoint independently.
- If CAS is configured to NOT enforce endpoint security rules, then all endpoints are considered sensitive and require authentication, typically handled via basic authentication with master credentials defined in CAS settings.
- If CAS is configured to enforce endpoint security rules, then each endpoint may be tagged with a specific security rule allowing access via authorized IP addresses, basic credentials, roles and attributes, etc.
There is a special endpoint named defaults which serves as a shortcut that
controls the security of all endpoints, if left undefined in CAS settings.
To enable additional logging, configure the log4j configuration file to add the following levels:
1
2
3
4
5
6
7
8
<Logger name="org.pac4j" level="debug" additivity="false">
<AppenderRef ref="console" />
<AppenderRef ref="file" />
</Logger>
<Logger name="org.springframework.security" level="debug" additivity="false">
<AppenderRef ref="console" />
<AppenderRef ref="file" />
</Logger>
Get single token by id.
Ticket |
|
org.apereo.cas.support.oauth.web.mgmt.OAuth20TokenManagementEndpoint |
Endpoint Details: oauthTokens/{token}
Endpoint Parameters:
-
token
CAS, being a Spring-Boot application at heart, includes a number of endpoints to help you monitor and manage the server when it’s pushed to production. You can choose to manage and monitor the deployment using HTTP endpoints, referred to as actuators.
In essence, actuator endpoints bring production-ready features to CAS. Monitoring a running CAS instance, gathering metrics, understanding traffic or the state of our database becomes trivial with such endpoints. The main benefit of these endpoints is that we can get production grade tools without having to actually implement these features ourselves. Actuators are mainly used to expose operational information about the running application – health, metrics, etc. These are HTTP endpoints or JMX beans to enable us to interact with it.
Actuator endpoints are presented by CAS in two categories:
- Those that are owned and defined by the CAS project.
- Those that are owned and defined by third-party projects, frameworks and libraries such as Spring Boot.
Note that by default the only endpoints exposed over the web
are info, status, health and configurationMetadata.
Other endpoints need to be explicitly enabled and then
exposed over the web in CAS settings in order to allow access.
To enable and expose an actuator endpoint:
1
2
3
4
5
management.endpoint.oauthTokens.enabled=true
management.endpoints.web.exposure.include=oauthTokens
# Choose the proper security access level...
# cas.monitor.endpoints.endpoint.oauthTokens.access=PERMIT
The following settings and properties are available from the CAS configuration catalog:
- Required
- Optional
- Signing & Encryption
- Hibernate & JDBC
- Email Servers
- LDAP & Active Directory
- Authentication
- Password Encoding
- Principal Transformation
- Password Policy
cas.monitor.endpoints.form-login-enabled=false
Control whether access to endpoints can be controlled via form-based login over the web via a special admin login endpoint. |
cas.monitor.endpoints.endpoint.[key].access=
Define the security access level of the endpoint. Available values are as follows:
|
cas.monitor.endpoints.endpoint.[key].required-authorities=
Required user authorities. |
cas.monitor.endpoints.endpoint.[key].required-ip-addresses=
Required ip addresses. |
cas.monitor.endpoints.endpoint.[key].required-roles=
Required user roles. |
Endpoints may be mapped to custom arbitrary endpoints. For example,
to remap the health endpoint to healthcheck,
specify the following settings:
1
# management.endpoints.web.path-mapping.health=healthcheck
management.endpoint.health.cache.time-to-live=0ms
Maximum time that a response can be cached. |
management.endpoint.health.enabled=true
Whether to enable the health endpoint. |
management.endpoint.health.group=
Health endpoint groups. |
management.endpoint.health.logging.slow-indicator-threshold=10s
Threshold after which a warning will be logged for slow health indicators. |
management.endpoint.health.probes.add-additional-paths=false
Whether to make the liveness and readiness health groups available on the main server port. |
management.endpoint.health.probes.enabled=false
Whether to enable liveness and readiness probes. |
management.endpoint.health.roles=
Roles used to determine whether a user is authorized to be shown details. When empty, all authenticated users are authorized. |
management.endpoint.health.show-components=
When to show components. If not specified the 'show-details' setting will be used. |
management.endpoint.health.show-details=never
When to show full health details. |
management.endpoint.health.status.http-mapping=
Mapping of health statuses to HTTP status codes. By default, registered health statuses map to sensible defaults (for example, UP maps to 200). |
management.endpoint.health.status.order=DOWNOUT_OF_SERVICEUPUNKNOWN
Comma-separated list of health statuses in order of severity. |
management.endpoints.enabled-by-default=
Whether to enable or disable all endpoints by default. |
management.endpoints.jmx.domain=org.springframework.boot
Endpoints JMX domain name. Fallback to 'spring.jmx.default-domain' if set. |
management.endpoints.jmx.exposure.exclude=
Endpoint IDs that should be excluded or '*' for all. |
management.endpoints.jmx.exposure.include=*
Endpoint IDs that should be included or '*' for all. |
management.endpoints.jmx.static-names=
Additional static properties to append to all ObjectNames of MBeans representing Endpoints. |
management.endpoints.jmx.unique-names=
Whether unique runtime object names should be ensured. Deprecation status is |
management.endpoints.migrate-legacy-ids=false
Whether to transparently migrate legacy endpoint IDs. |
management.endpoints.web.base-path=/actuator
Base path for Web endpoints. Relative to the servlet context path (server.servlet.context-path) or WebFlux base path (spring.webflux.base-path) when the management server is sharing the main server port. Relative to the management server base path (management.server.base-path) when a separate management server port (management.server.port) is configured. |
management.endpoints.web.cors.allow-credentials=
Whether credentials are supported. When not set, credentials are not supported. |
management.endpoints.web.cors.allowed-headers=
Comma-separated list of headers to allow in a request. '*' allows all headers. |
management.endpoints.web.cors.allowed-methods=
Comma-separated list of methods to allow. '*' allows all methods. When not set, defaults to GET. |
management.endpoints.web.cors.allowed-origin-patterns=
Comma-separated list of origin patterns to allow. Unlike allowed origins which only supports '*', origin patterns are more flexible (for example 'https://*.example.com') and can be used when credentials are allowed. When no allowed origin patterns or allowed origins are set, CORS support is disabled. |
management.endpoints.web.cors.allowed-origins=
Comma-separated list of origins to allow. '*' allows all origins. When credentials are allowed, '*' cannot be used and origin patterns should be configured instead. When no allowed origins or allowed origin patterns are set, CORS support is disabled. |
management.endpoints.web.cors.exposed-headers=
Comma-separated list of headers to include in a response. |
management.endpoints.web.cors.max-age=1800s
How long the response from a pre-flight request can be cached by clients. If a duration suffix is not specified, seconds will be used. |
management.endpoints.web.discovery.enabled=true
Whether the discovery page is enabled. |
management.endpoints.web.exposure.exclude=
Endpoint IDs that should be excluded or '*' for all. |
management.endpoints.web.exposure.include=health
Endpoint IDs that should be included or '*' for all. |
management.endpoints.web.path-mapping=
Mapping between endpoint IDs and the path that should expose them. |
management.health.binders.enabled=true
Allows to enable/disable binder's' health indicators. If you want to disable health indicator completely, then set it to `false`. |
management.health.cassandra.enabled=true
Whether to enable Cassandra health check. |
management.health.couchbase.enabled=true
Whether to enable Couchbase health check. |
management.health.couchbase.timeout=1000ms
Timeout for getting the Bucket information from the server. Deprecation status is |
management.health.db.enabled=true
Whether to enable database health check. |
management.health.db.ignore-routing-data-sources=false
Whether to ignore AbstractRoutingDataSources when creating database health indicators. |
management.health.defaults.enabled=true
Whether to enable default health indicators. |
management.health.diskspace.enabled=true
Whether to enable disk space health check. |
management.health.diskspace.path=
Path used to compute the available disk space. |
management.health.diskspace.threshold=10MB
Minimum disk space that should be available. |
management.health.elasticsearch.enabled=true
Whether to enable Elasticsearch health check. |
management.health.elasticsearch.indices=
Comma-separated index names. Deprecation status is |
management.health.elasticsearch.response-timeout=
Time to wait for a response from the cluster. Deprecation status is |
management.health.influxdb.enabled=true
Whether to enable InfluxDB health check. |
management.health.jms.enabled=true
Whether to enable JMS health check. |
management.health.ldap.enabled=true
Whether to enable LDAP health check. |
management.health.livenessstate.enabled=false
Whether to enable liveness state health check. |
management.health.mail.enabled=true
Whether to enable Mail health check. |
management.health.mongo.enabled=true
Whether to enable MongoDB health check. |
management.health.neo4j.enabled=true
Whether to enable Neo4j health check. |
management.health.ping.enabled=true
Whether to enable ping health check. |
management.health.probes.enabled=false
Whether to enable liveness and readiness probes. Deprecation status is |
management.health.rabbit.enabled=true
Whether to enable RabbitMQ health check. |
management.health.readinessstate.enabled=false
Whether to enable readiness state health check. |
management.health.redis.enabled=true
Whether to enable Redis health check. |
management.health.refresh.enabled=true
Enable the health endpoint for the refresh scope. |
management.health.solr.enabled=true
Whether to enable Solr health check. |
management.health.zookeeper.enabled=true
Enable the health endpoint for zookeeper. |
spring.security.user.name=user
Default user name. |
spring.security.user.password=
Password for the default user name. |
spring.security.user.roles=
Granted roles for the default user name. |
For basic authentication, the default username is casuser. The password may be automatically generated at startup and displayed in CAS logs if it is left undefined in CAS settings. Additional sources may also be defined that would authenticate the request via JAAS, LDAP, JDBC, etc.
Once endpoints are enabled and exposed, the security of all provided endpoints is handled by the Spring Security project. Protection and access to each endpoint is controlled via CAS settings individually such that you may decide a specific security level and method of authentication for each endpoint independently.
- If CAS is configured to NOT enforce endpoint security rules, then all endpoints are considered sensitive and require authentication, typically handled via basic authentication with master credentials defined in CAS settings.
- If CAS is configured to enforce endpoint security rules, then each endpoint may be tagged with a specific security rule allowing access via authorized IP addresses, basic credentials, roles and attributes, etc.
There is a special endpoint named defaults which serves as a shortcut that
controls the security of all endpoints, if left undefined in CAS settings.
To enable additional logging, configure the log4j configuration file to add the following levels:
1
2
3
4
5
6
7
8
<Logger name="org.pac4j" level="debug" additivity="false">
<AppenderRef ref="console" />
<AppenderRef ref="file" />
</Logger>
<Logger name="org.springframework.security" level="debug" additivity="false">
<AppenderRef ref="console" />
<AppenderRef ref="file" />
</Logger>
Configuration
Support is enabled by including the following dependency in the WAR overlay:
1
2
3
4
5
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-oauth-webflow</artifactId>
<version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-oauth-webflow:${project.'cas.version'}"
1
2
3
4
5
6
7
8
9
dependencyManagement {
imports {
mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
}
}
dependencies {
implementation "org.apereo.cas:cas-server-support-oauth-webflow"
}
The following settings and properties are available from the CAS configuration catalog:
- Required
- Optional
- Signing & Encryption
- Hibernate & JDBC
- Email Servers
- LDAP & Active Directory
- Authentication
- Password Encoding
- Principal Transformation
- Password Policy
- Notes
cas.authn.oauth.access-token.crypto.encryption.key=
The encryption key is a JWT whose length is defined by the encryption key size setting. |
cas.authn.oauth.access-token.crypto.signing.key=
The signing key is a JWT whose length is defined by the signing key size setting. |
cas.authn.oauth.crypto.encryption.key=
The encryption key is a JWT whose length is defined by the encryption key size setting. |
cas.authn.oauth.crypto.signing.key=
The signing key is a JWT whose length is defined by the signing key size setting. |
cas.authn.oauth.session-replication.replicate-sessions=true
Indicates whether profiles and other session data, collected as part of authentication flows and protocol requests that are kept by the container session, should be replicated across the cluster using CAS and its own ticket registry. Without this option, profile data and other related pieces of information should be manually replicated via means and libraries outside of CAS. |
cas.authn.oauth.csrf-cookie.comment=CAS Cookie
CAS Cookie comment, describes the cookie's usage and purpose. |
cas.authn.oauth.csrf-cookie.domain=
Cookie domain. Specifies the domain within which this cookie should be presented. The form of the domain name is specified by RFC 2965. A domain name begins with a dot (.foo.com) and means that the cookie is visible to servers in a specified Domain Name System (DNS) zone (for example, www.foo.com, but not a.b.foo.com). By default, cookies are only returned to the server that sent them. |
cas.authn.oauth.csrf-cookie.http-only=true
true if this cookie contains the HttpOnly attribute. This means that the cookie should not be accessible to scripting engines, like javascript. |
cas.authn.oauth.csrf-cookie.max-age=-1
The maximum age of the cookie, specified in seconds. By default, |
cas.authn.oauth.csrf-cookie.name=
Cookie name. Constructs a cookie with a specified name and value. The name must conform to RFC 2965. That means it can contain only ASCII alphanumeric characters and cannot contain commas, semicolons, or white space or begin with a |
cas.authn.oauth.csrf-cookie.path=
Cookie path. Specifies a path for the cookie to which the client should return the cookie. The cookie is visible to all the pages in the directory you specify, and all the pages in that directory's subdirectories. A cookie's path must include the servlet that set the cookie, for example, /catalog, which makes the cookie visible to all directories on the server under /catalog. Consult RFC 2965 (available on the Internet) for more information on setting path names for cookies. |
cas.authn.oauth.csrf-cookie.same-site-policy=
If a cookie is only intended to be accessed in a first party context, the developer has the option to apply one of settings SameSite=None, to designate cookies for cross-site access. When the SameSite=None attribute is present, an additional Secure attribute is used so cross-site cookies can only be accessed over HTTPS connections. Accepted values are:
|
cas.authn.oauth.csrf-cookie.secure=true
True if sending this cookie should be restricted to a secure protocol, or false if the it can be sent using any protocol. |
cas.authn.oauth.access-token.crypto.alg=
The signing/encryption algorithm to use. |
cas.authn.oauth.access-token.crypto.enabled=true
Whether crypto operations are enabled. |
cas.authn.oauth.access-token.crypto.encryption-enabled=true
Whether crypto encryption operations are enabled. |
cas.authn.oauth.access-token.crypto.encryption.key-size=512
The encryption key size. |
cas.authn.oauth.access-token.crypto.signing-enabled=true
Whether crypto signing operations are enabled. |
cas.authn.oauth.access-token.crypto.signing.key-size=512
The signing key size. |
cas.authn.oauth.access-token.crypto.strategy-type=ENCRYPT_AND_SIGN
Control the cipher sequence of operations. The accepted values are:
|
cas.authn.oauth.crypto.alg=
The signing/encryption algorithm to use. |
cas.authn.oauth.crypto.enabled=true
Whether crypto operations are enabled. |
cas.authn.oauth.crypto.encryption-enabled=true
Whether crypto encryption operations are enabled. |
cas.authn.oauth.crypto.encryption.key-size=512
The encryption key size. |
cas.authn.oauth.crypto.signing-enabled=true
Whether crypto signing operations are enabled. |
cas.authn.oauth.crypto.signing.key-size=512
The signing key size. |
cas.authn.oauth.crypto.strategy-type=ENCRYPT_AND_SIGN
Control the cipher sequence of operations. The accepted values are:
|
cas.authn.oauth.access-token.create-as-jwt=false
Create access token as JWTs. |
cas.authn.oauth.access-token.max-time-to-live-in-seconds=PT8H
Hard timeout to kill the access token and expire it. This settings supports the
|
cas.authn.oauth.access-token.storage-name=oauthAccessTokensCache
The storage object name used and created by CAS to hold OAuth access tokens in the backing ticket registry implementation. |
cas.authn.oauth.access-token.time-to-kill-in-seconds=PT2H
Sliding window for the access token expiration policy. Essentially, this is an idle time out. This settings supports the
|
cas.authn.oauth.code.number-of-uses=1
Number of times this code is valid and can be used. |
cas.authn.oauth.code.remove-related-access-tokens=false
Remove the related access tokens when trying to use a code which is expired or no longer exists. |
cas.authn.oauth.code.storage-name=oauthCodesCache
The storage object name used and created by CAS to hold OAuth codes in the backing ticket registry implementation. |
cas.authn.oauth.code.time-to-kill-in-seconds=30
Duration in seconds where the code is valid. |
cas.authn.oauth.core.bypass-approval-prompt=false
Whether approval prompt/consent screen should be bypassed. |
cas.authn.oauth.core.user-profile-view-type=NESTED
User profile view type determines how the final user profile should be rendered once an access token is "validated". Available values are as follows:
|
cas.authn.oauth.device-token.max-time-to-live-in-seconds=PT5M
Hard timeout to kill the device token and expire it. This settings supports the
|
cas.authn.oauth.device-token.refresh-interval=PT15S
The device refresh interval. The client should attempt to acquire an access token every few seconds (at a rate specified by interval) by POSTing to the access token endpoint on the server. This settings supports the
|
cas.authn.oauth.device-token.storage-name=oauthDeviceTokensCache
The storage object name used and created by CAS to hold OAuth device tokens in the backing ticket registry implementation. |
cas.authn.oauth.device-user-code.max-time-to-live-in-seconds=PT1M
Hard timeout to kill the token and expire it. This settings supports the
|
cas.authn.oauth.device-user-code.storage-name=oauthDeviceUserCodesCache
The storage object name used and created by CAS to hold OAuth device user codes in the backing ticket registry implementation. |
cas.authn.oauth.device-user-code.user-code-length=8
Length of the generated user code. |
cas.authn.oauth.grants.resource-owner.require-service-header=false
Whether using the resource-owner grant should enforce authorization rules and per-service policies based on a service parameter is provided as a header outside the normal semantics of the grant and protocol. |
cas.authn.oauth.refresh-token.storage-name=oauthRefreshTokensCache
The storage object name used and created by CAS to hold OAuth refresh tokens in the backing ticket registry implementation. |
cas.authn.oauth.refresh-token.time-to-kill-in-seconds=P14D
Hard timeout beyond which the refresh token is considered expired. This settings supports the
|
cas.authn.oauth.session-replication.cookie.allowed-ip-addresses-pattern=
A regular expression pattern that indicates the set of allowed IP addresses, when |
cas.authn.oauth.session-replication.cookie.auto-configure-cookie-path=true
Decide if cookie paths should be automatically configured based on the application context path, when the cookie path is not configured. |
cas.authn.oauth.session-replication.cookie.comment=CAS Cookie
CAS Cookie comment, describes the cookie's usage and purpose. |
cas.authn.oauth.session-replication.cookie.domain=
Cookie domain. Specifies the domain within which this cookie should be presented. The form of the domain name is specified by RFC 2965. A domain name begins with a dot (.foo.com) and means that the cookie is visible to servers in a specified Domain Name System (DNS) zone (for example, www.foo.com, but not a.b.foo.com). By default, cookies are only returned to the server that sent them. |
cas.authn.oauth.session-replication.cookie.http-only=true
true if this cookie contains the HttpOnly attribute. This means that the cookie should not be accessible to scripting engines, like javascript. |
cas.authn.oauth.session-replication.cookie.max-age=-1
The maximum age of the cookie, specified in seconds. By default, |
cas.authn.oauth.session-replication.cookie.name=
Cookie name. Constructs a cookie with a specified name and value. The name must conform to RFC 2965. That means it can contain only ASCII alphanumeric characters and cannot contain commas, semicolons, or white space or begin with a |
cas.authn.oauth.session-replication.cookie.path=
Cookie path. Specifies a path for the cookie to which the client should return the cookie. The cookie is visible to all the pages in the directory you specify, and all the pages in that directory's subdirectories. A cookie's path must include the servlet that set the cookie, for example, /catalog, which makes the cookie visible to all directories on the server under /catalog. Consult RFC 2965 (available on the Internet) for more information on setting path names for cookies. |
cas.authn.oauth.session-replication.cookie.pin-to-session=true
When generating cookie values, determine whether the value should be compounded and signed with the properties of the current session, such as IP address, user-agent, etc. |
cas.authn.oauth.session-replication.cookie.same-site-policy=
If a cookie is only intended to be accessed in a first party context, the developer has the option to apply one of settings SameSite=None, to designate cookies for cross-site access. When the SameSite=None attribute is present, an additional Secure attribute is used so cross-site cookies can only be accessed over HTTPS connections. Accepted values are:
|
cas.authn.oauth.session-replication.cookie.secure=true
True if sending this cookie should be restricted to a secure protocol, or false if the it can be sent using any protocol. |
cas.authn.oauth.access-token.crypto.encryption.key=
The encryption key is a JWT whose length is defined by the encryption key size setting. |
cas.authn.oauth.access-token.crypto.signing.key=
The signing key is a JWT whose length is defined by the signing key size setting. |
cas.authn.oauth.crypto.encryption.key=
The encryption key is a JWT whose length is defined by the encryption key size setting. |
cas.authn.oauth.crypto.signing.key=
The signing key is a JWT whose length is defined by the signing key size setting. |
cas.authn.oauth.access-token.crypto.alg=
The signing/encryption algorithm to use. |
cas.authn.oauth.access-token.crypto.enabled=true
Whether crypto operations are enabled. |
cas.authn.oauth.access-token.crypto.encryption-enabled=true
Whether crypto encryption operations are enabled. |
cas.authn.oauth.access-token.crypto.encryption.key-size=512
The encryption key size. |
cas.authn.oauth.access-token.crypto.signing-enabled=true
Whether crypto signing operations are enabled. |
cas.authn.oauth.access-token.crypto.signing.key-size=512
The signing key size. |
cas.authn.oauth.access-token.crypto.strategy-type=ENCRYPT_AND_SIGN
Control the cipher sequence of operations. The accepted values are:
|
cas.authn.oauth.crypto.alg=
The signing/encryption algorithm to use. |
cas.authn.oauth.crypto.enabled=true
Whether crypto operations are enabled. |
cas.authn.oauth.crypto.encryption-enabled=true
Whether crypto encryption operations are enabled. |
cas.authn.oauth.crypto.encryption.key-size=512
The encryption key size. |
cas.authn.oauth.crypto.signing-enabled=true
Whether crypto signing operations are enabled. |
cas.authn.oauth.crypto.signing.key-size=512
The signing key size. |
cas.authn.oauth.crypto.strategy-type=ENCRYPT_AND_SIGN
Control the cipher sequence of operations. The accepted values are:
|
This CAS feature is able to accept signing and encryption crypto keys. In most scenarios if keys are not provided, CAS will auto-generate them. The following instructions apply if you wish to manually and beforehand create the signing and encryption keys.
Note that if you are asked to create a JWK of a certain size for the key, you are to use the following set of commands to generate the token:
1
2
wget https://raw.githubusercontent.com/apereo/cas/master/etc/jwk-gen.jar
java -jar jwk-gen.jar -t oct -s [size]
The outcome would be similar to:
1
2
3
4
5
{
"kty": "oct",
"kid": "...",
"k": "..."
}
The generated value for k needs to be assigned to the relevant CAS settings. Note that keys generated via
the above algorithm are processed by CAS using the Advanced Encryption Standard (AES) algorithm which is a
specification for the encryption of electronic data established by the U.S. National Institute of Standards and Technology.
Configuration Metadata
The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.
Be Selective
This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.
YAGNI
Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.
Naming Convention
Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all
forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where
this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those
that might be presented to the system via an external library or framework such as Spring Boot, etc.
When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value.
The only possible exception to this rule is when naming actuator endpoints; The name of the
actuator endpoints (i.e. ssoSessions) MUST remain in camelCase mode.
Settings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided
to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with
the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition
or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the
way you intend.
Validation
Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be
recognized or validated by the configuration schema. The validation process is on by default and can be skipped on startup using a special system
property SKIP_CONFIG_VALIDATION that should be set to true. Additional validation processes are also handled
via Configuration Metadata and property migrations applied automatically on
startup by Spring Boot and family.
Indexed Settings
CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be
incremented by the adopter to allow for distinct multiple configuration blocks.
Endpoints
After enabling OAuth support, the following endpoints will be available:
| Endpoint | Description | Method |
|---|---|---|
/oauth2.0/authorize |
Authorize the user and start the CAS authentication flow. | GET |
/oauth2.0/accessToken,/oauth2.0/token |
Get an access token in plain-text or JSON | POST |
/oauth2.0/profile |
Get the authenticated user profile in JSON via access_token parameter. |
GET |
/oauth2.0/introspect |
Query CAS to detect the status of a given access token via introspection. This endpoint expects HTTP basic authentication with OAuth2 service client_id and client_secret associated as username and password. |
POST |
/oauth2.0/device |
Approve device user codes via the device flow protocol. | POST |
/oauth2.0/revoke |
Revoke access or refresh tokens. This endpoint expects HTTP basic authentication with OAuth2 service client_id and client_secret associated as username and password. |
 |
Response/Grant Types
The following types are supported; they allow you to get an access token representing the current user and OAuth
client application. With the access token, you’ll be able to query the /profile endpoint and get the user profile.
Authorization Code
The authorization code type is made for UI interactions: the user will enter credentials, shall receive a code and will exchange that code for an access token.
| Endpoint | Parameters | Response |
|---|---|---|
/oauth2.0/authorize |
response_type=code&client_id=<ID>&redirect_uri=<CALLBACK> |
OAuth code as a parameter of the CALLBACK url. |
/oauth2.0/accessToken |
grant_type=authorization_code&client_id=ID&client_secret=SECRET&code=CODE&redirect_uri=CALLBACK |
The access token. |
Proof Key Code Exchange (PKCE)
The Proof Key for Code Exchange (PKCE, pronounced pixie) extension describes a technique for public clients to mitigate the threat of having the authorization code intercepted. The technique involves the client first creating a secret, and then using that secret again when exchanging the authorization code for an access token. This way if the code is intercepted, it will not be useful since the token request relies on the initial secret.
The authorization code type at the authorization endpoint /oauth2.0/authorize is able to accept the following parameters to activate PKCE:
| Parameter | Description |
|---|---|
code_challenge |
The code challenge generated using the method below. |
code_challenge_method |
plain, S256. This parameter is optional, where plain is assumed by default. |
The /oauth2.0/accessToken endpoint is able to accept the following parameters to activate PKCE:
| Parameter | Description |
|---|---|
code_verifier |
The original code verifier for the PKCE request, that the app originally generated before the authorization request. |
If the method is plain, then the CAS needs only to check that the provided code_verifier matches the expected code_challenge string.
If the method is S256, then the CAS should take the provided code_verifier and transform it using the same method the client will have used initially. This means calculating the SHA256 hash of the verifier and base64-url-encoding it, then comparing it to the stored code_challenge.
If the verifier matches the expected value, then the CAS can continue on as normal, issuing an access token and responding appropriately.
Token/Implicit
The token type is also made for UI interactions as well as indirect non-interactive (i.e. Javascript) applications.
| Endpoint | Parameters | Response |
|---|---|---|
/oauth2.0/authorize |
response_type=token&client_id=ID&redirect_uri=CALLBACK |
The access token as an anchor parameter of the CALLBACK url. |
Resource Owner Credentials
The password grant type allows the OAuth client to directly send the user’s credentials to the OAuth server.
This grant is a great user experience for trusted first party clients both on the web and in native device applications.
| Endpoint | Parameters | Response |
|---|---|---|
/oauth2.0/accessToken |
grant_type=password&client_id=ID&client_secret=<SECRET>&username=USERNAME&password=PASSWORD |
The access token. |
Because there is no redirect_uri specified by this grant type, the service identifier recognized by CAS and matched in the service registry is taken as the client_id instead. You may optionally also pass along a service or X-service header value that identifies the target application url. The header value must match the OAuth service definition in the registry that is linked to the client id.
Client Credentials
The simplest of all of the OAuth grants, this grant is suitable for machine-to-machine authentication where a specific user’s permission to access data is not required.
| Endpoint | Parameters | Response |
|---|---|---|
/oauth2.0/accessToken |
grant_type=client_credentials&client_id=client&client_secret=secret |
The access token. |
Because there is no redirect_uri specified by this grant type, the service identifier recognized by CAS and matched in the service registry is taken as the client_id instead. You may optionally also pass along a service or X-service header value that identifies the target application url. The header value must match the OAuth service definition in the registry that is linked to the client id.
Refresh Token
The refresh token grant type retrieves a new access token from a refresh token (emitted for a previous access token), when this previous access token is expired.
| Endpoint | Parameters | Response |
|---|---|---|
/oauth2.0/accessToken |
grant_type=refresh_token&client_id=<ID>&client_secret=SECRET&refresh_token=REFRESH_TOKEN |
The new access token. |
Device Flow
| Endpoint | Parameters | Response |
|---|---|---|
/oauth2.0/accessToken |
response_type=device_code&client_id=<ID> |
Device authorization url, device code and user code. |
/oauth2.0/accessToken |
response_type=device_code&client_id=<ID>&code=<DEVICE_CODE> |
New access token once the user code is approved. |
Grant Type Selection
A grant is a method of acquiring an access token. Deciding which grants to implement depends on the type of client the end user will be using, and the experience you want for your users.
To learn more about profiles and grant types, please review this guide.
Client Registration
Please see this guide.
OAuth Token Expiration Policy
Please see this guide.
JWT Access Tokens
By default, OAuth access tokens are created as opaque identifiers. There is also the option to generate JWTs as access tokens on a per-service basis:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"@class" : "org.apereo.cas.support.oauth.services.OAuthRegisteredService",
"clientId": "clientid",
"clientSecret": "clientSecret",
"serviceId" : "^(https|imaps)://<redirect-uri>.*",
"name" : "OAuthService",
"id" : 100,
"jwtAccessToken": true,
"properties" : {
"@class" : "java.util.HashMap",
"accessTokenAsJwtSigningKey" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ "..." ] ]
},
"accessTokenAsJwtEncryptionKey" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ "..." ] ]
},
"accessTokenAsJwtSigningEnabled" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ "true" ] ]
},
"accessTokenAsJwtEncryptionEnabled" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ "true" ] ]
},
"accessTokenAsJwtCipherStrategyType" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
"values" : [ "java.util.HashSet", [ "ENCRYPT_AND_SIGN" ] ]
}
}
}
Signing and encryption keys may also be defined on a per-service basis, or globally via CAS settings.
The following properties are available and recognized by CAS for various modules and features:
| Name | Default Value | Type | Group |
|---|---|---|---|
accessTokenAsJwtSigningKey
|
|
STRING
|
JWT_ACCESS_TOKENS
|
accessTokenAsJwtCipherStrategyType
|
ENCRYPT_AND_SIGN
|
STRING
|
JWT_ACCESS_TOKENS
|
accessTokenAsJwtSigningEnabled
|
true
|
BOOLEAN
|
JWT_ACCESS_TOKENS
|
accessTokenAsJwtEncryptionEnabled
|
false
|
BOOLEAN
|
JWT_ACCESS_TOKENS
|
accessTokenAsJwtEncryptionKey
|
|
STRING
|
JWT_ACCESS_TOKENS
|
OAuth User Profile Structure
Please see this guide.
Throttling
Authentication throttling may be enabled for the /oauth2.0/accessToken provided support
is included in the overlay to turn on authentication
throttling support. The throttling
mechanism that handles the usual CAS server endpoints for authentication
and ticket validation, etc is then activated for the OAuth
endpoints that are supported for throttling.
CSRF Cookie Configuration
The following settings and properties are available from the CAS configuration catalog:
- Required
- Optional
- Signing & Encryption
- Hibernate & JDBC
- Email Servers
- LDAP & Active Directory
- Authentication
- Password Encoding
- Principal Transformation
- Password Policy
- Notes
cas.authn.oauth.csrf-cookie.comment=CAS Cookie
CAS Cookie comment, describes the cookie's usage and purpose. |
cas.authn.oauth.csrf-cookie.domain=
Cookie domain. Specifies the domain within which this cookie should be presented. The form of the domain name is specified by RFC 2965. A domain name begins with a dot (.foo.com) and means that the cookie is visible to servers in a specified Domain Name System (DNS) zone (for example, www.foo.com, but not a.b.foo.com). By default, cookies are only returned to the server that sent them. |
cas.authn.oauth.csrf-cookie.http-only=true
true if this cookie contains the HttpOnly attribute. This means that the cookie should not be accessible to scripting engines, like javascript. |
cas.authn.oauth.csrf-cookie.max-age=-1
The maximum age of the cookie, specified in seconds. By default, |
cas.authn.oauth.csrf-cookie.name=
Cookie name. Constructs a cookie with a specified name and value. The name must conform to RFC 2965. That means it can contain only ASCII alphanumeric characters and cannot contain commas, semicolons, or white space or begin with a |
cas.authn.oauth.csrf-cookie.path=
Cookie path. Specifies a path for the cookie to which the client should return the cookie. The cookie is visible to all the pages in the directory you specify, and all the pages in that directory's subdirectories. A cookie's path must include the servlet that set the cookie, for example, /catalog, which makes the cookie visible to all directories on the server under /catalog. Consult RFC 2965 (available on the Internet) for more information on setting path names for cookies. |
cas.authn.oauth.csrf-cookie.same-site-policy=
If a cookie is only intended to be accessed in a first party context, the developer has the option to apply one of settings SameSite=None, to designate cookies for cross-site access. When the SameSite=None attribute is present, an additional Secure attribute is used so cross-site cookies can only be accessed over HTTPS connections. Accepted values are:
|
cas.authn.oauth.csrf-cookie.secure=true
True if sending this cookie should be restricted to a secure protocol, or false if the it can be sent using any protocol. |
Configuration Metadata
The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.
Be Selective
This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.
YAGNI
Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.
Naming Convention
Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all
forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where
this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those
that might be presented to the system via an external library or framework such as Spring Boot, etc.
When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value.
The only possible exception to this rule is when naming actuator endpoints; The name of the
actuator endpoints (i.e. ssoSessions) MUST remain in camelCase mode.
Settings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided
to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with
the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition
or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the
way you intend.
Validation
Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be
recognized or validated by the configuration schema. The validation process is on by default and can be skipped on startup using a special system
property SKIP_CONFIG_VALIDATION that should be set to true. Additional validation processes are also handled
via Configuration Metadata and property migrations applied automatically on
startup by Spring Boot and family.
Indexed Settings
CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be
incremented by the adopter to allow for distinct multiple configuration blocks.